import type { Course } from '@/type'
import { createGlobalState } from '@vueuse/core'
import { ref } from 'vue'
// import { courses } from '@/datasource'
// import { loginStore } from './user'

export const courseStore = createGlobalState(() => {
  // 存当前登录老师的课程
  const coursesS = ref<Course[]>([])
  const idS = ref(4)
  // 下面两行是模拟登录完成后获取课程内容存入缓存
  // const userS = loginStore().userS
  // coursesS.value = courses.filter((course) => course.uid === userS.value.uid)
  return {
    coursesS,
    idS
  }
})
